@extends('admin.layouts.master')
@section('title', '后台管理系统')
@section('content')



    <div class="admin-biaogelist">
        <div class="listbiaoti am-cf">
            <ul class="am-icon-flag on">
                商品栏目管理
            </ul>
            <dl class="am-icon-home" style="float: right;">
                当前位置： 首页 > <a href="#">商品列表</a>
            </dl>
            <dl>
                <button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus"
                        data-am-modal="{target: '#my-popup'}">添加商品一级分类
                </button>
            </dl>

        </div>
        <ul class="am-tree" id="firstTree">
            <!-- 包含子级的条目模板 -->
            <li class="am-tree-branch am-hide" data-template="treebranch">
                <div class="am-tree-branch-header">
                    <button class="am-tree-branch-name">
                        <span class="am-tree-icon am-tree-icon-folder"></span>
                        <span class="am-tree-label"></span>
                    </button>
                </div>
                <ul class="am-tree-branch-children"></ul>
                <div class="am-tree-loader">Loading...</div>
            </li>

            <!-- 不包含子级的条目模板 -->
            <li class="am-tree-item am-hide" data-template="treeitem">
                <button class="am-tree-item-name">
                    <span class="am-tree-icon am-tree-icon-item"></span>
                    <span class="am-tree-label"></span>
                </button>
            </li>
        </ul>

    </div>
    <script>
        // demo 1
        $(function(){

            $('#firstTree').tree({
                dataSource: function(options, callback) {

                    $.get('catalog/1',options,function(data){
                        callback({data: options.products || data})
                    })

                },
                multiSelect: false,
                cacheItems: true,
                folderSelect: false
            });
        })

    </script>
@endsection